#define Eco_Variable

#include "userDef.h"

void EcoAction(void)
{
    if (b_eco.run == ON && b_power.run == ON && ((e_mode.run == MODECOOL)||(e_mode.run == MODEHEAT)))
    {
        switch (stat_EcoSw)
        {
        case 0:
            if (temp.roomAct >= 280)
            {
                stat_EcoSw = 1;
            }
            else
            {
                stat_EcoSw = 2;
            }
            break;

        case 1:
            if (temp.roomAct < 280 || EcoActMin >= 10)
            {
                stat_EcoSw = 2;
            }
            break;

        default:
            break;
        }
    }
    else
    {
        stat_EcoSw = 0;
    }
}

void EcoActTime(void)
{
    if (b_eco.run == ON && b_power.run == ON && ((e_mode.run == MODECOOL)||(e_mode.run == MODEHEAT)))
    {
        EcoActSec++;

        if (EcoActSec >= Norm60Fast02)
        {
            EcoActSec = 0;

            if (EcoActMin < 15)
            {
                EcoActMin++;
            }
        }
    }
    else
    {
        EcoActSec = 0;
        EcoActMin = 0;
    }
}
